package com.may.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.may.entity.Permission;
import com.may.entity.Role;
import com.may.entity.User;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author mayuanbao
 * @date 2020-07-08 20:49
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据用户名查询用户角色
     * @author mayuanbao
     * @date 2020/11/06 16:03
     * @param name name
     * @return java.util.List<com.may.entity.Role>
     */
    User findRoleByUserName(String name);

    /**
     * 根据角色id查询权限
     * @author mayuanbao
     * @date 2020-11-08 15:35
     * @param id id
     * @return java.util.List<com.may.entity.Permission>
     */
    List<Permission> findPermissionByRoleId(Integer id);
}
